package com.hjj.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAopFun {
//    final String xxx = "execution(* com.hjj.services..*.fun*(..))";

    @Pointcut(value = "execution(* com.hjj.services..*.fun*(..))")
    public void fun(){

    }

    @Before(value = "fun()")
    public void xxx1(JoinPoint joinPoint){
        System.out.println(joinPoint.getTarget().getClass().getName() + "." +joinPoint.getSignature().getName() + "ok开始执行.......");
    }

    @After(value = "fun()")
    public void xxx2(JoinPoint joinPoint){
        System.out.println(joinPoint.getTarget().getClass().getName() + "." +joinPoint.getSignature().getName() + "ok执行完毕.......");
    }
}
